#pragma once

#define SIZE 4096
#define	UMASK 0666

#define FLUSH_NONE 1
#define FLUSH_LINE 2
#define FLUSH_FULL 3

#define FORCE 1
#define NORMAL 2

typedef struct _MY_IO_FILE
{
	int fileno;//文件标识符
	int flag;//刷新策略
	char outbuffer[SIZE];//缓冲区
	int curr;//当前缓冲区中数据的个数
	int cap;//缓冲区的容量

}MyFile;

MyFile* mfopen(const char* filename,const char* mode);
int mfwrite(const char* ptr, int size, MyFile* fp);
void mfflush(MyFile* fp);
void mfclose(MyFile* fp);

